package com.base.api.controller.phoneBill;

import com.base.api.dto.phoneBill.PhoneBillListDTO;
import com.base.api.service.phoneBill.PhoneBillApiService;
import com.base.log.WebLog;
import com.base.result.ResponseResult;
import com.base.self.entity.PhoneBill;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/api/phoneBill")
//@Api(tags = "话费明细")
public class PhoneBillApiController {

    private final PhoneBillApiService phoneBillApiService;

    public PhoneBillApiController(PhoneBillApiService phoneBillApiService) {
        this.phoneBillApiService = phoneBillApiService;
    }

//    @ApiOperation(value="话费明细分页查询")
    @PostMapping(value = "/phoneBillList", produces = "application/json;charset=UTF-8")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK", response = PhoneBill.class),
    })
    @WebLog
    public ResponseResult phoneBillList(final @Validated PhoneBillListDTO phoneBillListDTO){
        return phoneBillApiService.phoneBillList(phoneBillListDTO);
    }
}
